#!/usr/bin/env python
# coding=utf-8

import RPi.GPIO as GPIO
import time 

class HcSr(object):
    channel = 12 

    def returnAirPollution(self):
        #初始化
        GPIO.setwarnings(False)
        GPIO.setmode(GPIO.BOARD)
        GPIO.setup(self.channel, GPIO.IN)

        ret = GPIO.input(channel)

        GPIO.cleanup()
        return ret

if __name__ == "__main__":

    hcsr = HcSr()
    print(hcsr.returnAirPollution())


        


        

    

